#pragma once
#include "cfgcommon.h"
#include "Property.h"

class CCfg
{
private:
    vector<Property>    m_vProperties;
    wstring             m_sFileName;
    bool                m_bAutoReloadFlag;
    long                m_lReloadDelay;

protected:
    int ParseLine(wstring lineBuff, Property &property);
    wstring Trim(wstring sourceStr);
    int Load();

public:
    wstring GetProperty(wstring propName);
    int SetProperty(wstring propName, wstring propValue);
    int Save();
    //STRING GetProperty(STRING propName, STRING defaultValue);
    //int GetInt(STRING propName);
    //int GetInt(STRING propName, int defaultValue);
    //long GetLong(STRING propName);
    //long GetLong(STRING propName, long defaultValue);

public:
    //CCfg(STRING fileName, long autoReloadDelay);
    CCfg(wstring fileName);
    ~CCfg(void);
};
